<?php

class MappingRule {
    public /* String */ $attributeName;
    public /* String */ $column; // or column-based formula
    public /* Boolean */ $is_pkey;
    public /* Boolean */ $is_writable;
    public /* Boolean */ $is_formula;
    public /* String */ $referredClass; //Refered dbItem object
    public /* String */ $referredColumn;
    // N:M Relations require a relation table.
    public /* String */ $relationTable;
    /* If the relation table has attributes has to be treated as a dbitem to recover its attributes.
     * object1 N:M object2 -> object1 N:1 relationitem 1:M object2. The query $object1->relationitem returns
     * a relationitem array with N items. Therefore a foreach may be needed to recover all object2 objects.
     */
    function __construct($attributeName, $column=null, $is_pkey=false, $is_writable=true, $is_formula=false, $referredClass=null, $referredColumn=null, $relationTable=null) {
        $this->attributeName = $attributeName;
        $this->column = $column; // or formula
        $this->is_pkey = $is_pkey;
        $this->is_writable = $is_writable;
        $This->is_formula = $is_formula;
        $this->referredClass = $referredClass;
        $this->referredColumn = $referredColumn;
        $this->relationTable = $relationTable;
    }

}
?>
